package org.stvd.entities.admin;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Transient;

import org.hibernate.validator.constraints.NotEmpty;
import org.springframework.format.annotation.DateTimeFormat;
import org.stvd.core.annotation.serializer.DateTimeSerializer;
import org.stvd.entities.base.BaseEntity;

import com.fasterxml.jackson.databind.annotation.JsonSerialize;

/**
 * 系统机构-实体类
 * @author houzx
 */
@Entity
@Table(name = "department")
public class Department extends BaseEntity {
    
    private static final long serialVersionUID = -3223393120977648123L;
    
    /**
     * 机构ID
     */
    @Id  
    @Column(name="dep_id",nullable=false) 
    private String depId = "";
    
    /**
     * 机构名称
     */
    @Column(name="dep_name",nullable=false) 
    @NotEmpty(message="机构名称不能为空！")
    private String depName = ""; 
    
    /**
     * 机构名称
     */
    @Column(name="dep_code",nullable=false)
    @NotEmpty(message="机构编码不能为空！")
    private String depCode = "";
    
    /**
     * 内部编码
     */
    @Column(name="inner_code")
    private String innerCode = "";
    
    /**
     * 拼音码
     */
    @Column(name="jsm")
    private String jsm = "";
    
    /**
     * 父级机构ID
     */
    @Column(name="upper_id")
    private String upperId = ""; 
    
    /*
     * 机构类别 C：公司;D：部门;G:团队;1:其它
     */
    @Column(name="dep_type")
    private String depType = "";
    
    /**
     * 所在省
     */
    @Column(name="province", nullable=false) 
    private String province = "";   
    
    /**
     * 所在市
     */
    @Column(name="city",nullable=false) 
    private String city = "";
    
    /**
     * 所在县区
     */
    @Column(name="region") 
    private String region = ""; 
    
    /**
     * 邮政编码
     */
    @Column(name="post_no") 
    private String postNo = "";  
    
    /**
     * 区域编码
     */
    @Column(name="area_no") 
    private String areaNo = "000000"; 
    /**
     * 详细地址
     */
    @Column(name="address") 
    private String address = ""; 
    /**
     * 负责人
     */
    @Column(name="principal") 
    private String principal = "";   
    /**
     * 电话号码
     */
    @Column(name="phone") 
    private String phone = "";   
    /**
     * 手机号码
     */
    @Column(name="mobil") 
    private String mobil = "";
    /**
     * 录入时间
     */
    @Column(name="input_date", nullable=false) 
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
    @JsonSerialize(using = DateTimeSerializer.class)
    private Date inputDate = null;
    /**
     * 操作人
     */
    @Column(name="operator",nullable=false)
    private String operator = ""; 
    /**
     * 备注
     */
    @Column(name="remark")
    private String remark = "";  
    
    /**
     * 启用状态 {T:启用；N:禁用}
     */
    @Column(name="status")
    private String status = "T";
    /**
     * 系统GUID
     */
    @Column(nullable=false)
    private String guid = "";
    
    @Transient
    private String state = "closed";
    @Transient
    private String provinceNo = "000000";   
    @Transient
    private String cityNo = "000000";   
    @Transient
    private String regionNo = "000000";
	public String getDepId() {
		return depId;
	}
	public void setDepId(String depId) {
		this.depId = depId;
	}
	public String getDepName() {
		return depName;
	}
	public void setDepName(String depName) {
		this.depName = depName;
	}
	public String getDepCode() {
		return depCode;
	}
	public void setDepCode(String depCode) {
		this.depCode = depCode;
	}
	public String getInnerCode() {
		return innerCode;
	}
	public void setInnerCode(String innerCode) {
		this.innerCode = innerCode;
	}
	public String getJsm() {
		return jsm;
	}
	public void setJsm(String jsm) {
		this.jsm = jsm;
	}
	public String getUpperId() {
		return upperId;
	}
	public void setUpperId(String upperId) {
		this.upperId = upperId;
	}
	public String getDepType() {
		return depType;
	}
	public void setDepType(String depType) {
		this.depType = depType;
	}
	public String getProvince() {
		return province;
	}
	public void setProvince(String province) {
		this.province = province;
	}
	public String getCity() {
		return city;
	}
	public void setCity(String city) {
		this.city = city;
	}
	public String getRegion() {
		return region;
	}
	public void setRegion(String region) {
		this.region = region;
	}
	public String getPostNo() {
		return postNo;
	}
	public void setPostNo(String postNo) {
		this.postNo = postNo;
	}
	public String getAreaNo() {
		return areaNo;
	}
	public void setAreaNo(String areaNo) {
		this.areaNo = areaNo;
	}
	public String getAddress() {
		return address;
	}
	public void setAddress(String address) {
		this.address = address;
	}
	public String getPrincipal() {
		return principal;
	}
	public void setPrincipal(String principal) {
		this.principal = principal;
	}
	public String getPhone() {
		return phone;
	}
	public void setPhone(String phone) {
		this.phone = phone;
	}
	public String getMobil() {
		return mobil;
	}
	public void setMobil(String mobil) {
		this.mobil = mobil;
	}
	public Date getInputDate() {
		return inputDate;
	}
	public void setInputDate(Date inputDate) {
		this.inputDate = inputDate;
	}
	public String getOperator() {
		return operator;
	}
	public void setOperator(String operator) {
		this.operator = operator;
	}
	public String getRemark() {
		return remark;
	}
	public void setRemark(String remark) {
		this.remark = remark;
	}
	public String getStatus() {
		return status;
	}
	public void setStatus(String status) {
		this.status = status;
	}
	public String getGuid() {
		return guid;
	}
	public void setGuid(String guid) {
		this.guid = guid;
	}
	public String getState() {
		return state;
	}
	public void setState(String state) {
		this.state = state;
	}
	public String getProvinceNo() {
		return provinceNo;
	}
	public void setProvinceNo(String provinceNo) {
		this.provinceNo = provinceNo;
	}
	public String getCityNo() {
		return cityNo;
	}
	public void setCityNo(String cityNo) {
		this.cityNo = cityNo;
	}
	public String getRegionNo() {
		return regionNo;
	}
	public void setRegionNo(String regionNo) {
		this.regionNo = regionNo;
	}
}
            